Fix #12643: Pipe structured BuilderProblems into DiagnosticCollector - #12647
Draft
gnodet wants to merge 2 commits into
Draft
Fix #12643: Pipe structured BuilderProblems into DiagnosticCollector#12647gnodet wants to merge 2 commits into
gnodet wants to merge 2 commits into
Conversation
…ollector Route structured validation problems from 4 pathways (settings, toolchains, model validation, graph building) into DefaultDiagnosticCollector so they appear in the build report with full key/suggestion/documentationUrl metadata instead of being re-logged as plain text. Pathways: - LookupInvoker: settings validation problems - MavenInvoker: toolchains validation problems - DefaultProjectsSelector: model validation problems (ModelProblem → BuilderProblem) - DefaultMaven: graph building problems (ModelProblem → BuilderProblem) Also adds EXCLUDED_LOGGERS in BuildReportCollector to prevent double-counting when the same problems are both piped structurally and logged via SLF4J. Migrates all test files from DefaultBuilderProblem constructor to BuilderProblem.builder() API. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Change the PluginValidationManager interface from String-based to BuilderProblem-based, enabling structured problem reporting with keys, severity, and suggestions throughout the plugin validation pipeline. - Change 3 abstract report methods from String issue to BuilderProblem - Add deprecated String-based default methods for backward compat - Update all 9 call sites (7 validators + 1 plugin manager) to create BuilderProblem with structured key, severity, and suggestion - Inject DefaultDiagnosticCollector into DefaultPluginValidationManager to pipe problems into the diagnostic pipeline - Add japicmp exclusion for the intentional API break - Add DefaultPluginValidationManager to EXCLUDED_LOGGERS in BuildReportCollector to prevent double-counting Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #12572 (Build Report Foundation). This PR implements the structured
BuilderProblempipeline for the 4 pathways identified in the foundation PR, plus a full migration of thePluginValidationManagerinterface.Commit 1: Pipe structured BuilderProblems into DiagnosticCollector (Pathways 1–4)
Pathway 1 — Model validation (
DefaultModelProblemCollector): already pipesBuilderProblemintoDiagnosticCollectorat model-build time. Verified existing.Pathway 2 — Plugin parameter validation (
AbstractMavenPluginParametersValidator): 3 validators (DeprecatedPluginValidator,DeprecatedCoreExpressionValidator,ReadOnlyPluginParametersValidator) now createBuilderProblemwith structured key, severity, and suggestion, and pipe throughPluginValidationManager→DiagnosticCollector.Pathway 3 — Plugin dependency validation (
AbstractMavenPluginDependenciesValidator): 4 validators (Maven2DependenciesValidator,Maven3CompatDependenciesValidator,MavenMixedDependenciesValidator,MavenScopeDependenciesValidator) now createBuilderProblemwith structured key and pipe throughPluginValidationManager→DiagnosticCollector.Pathway 4 — Plugin manager Contextualizable check (
DefaultMavenPluginManager): createsBuilderProblemwith keyplugin-validation:contextualizableand pipes throughPluginValidationManager→DiagnosticCollector.Pathway 5 —
PluginValidationManagerAPI →BuilderProblem: migrated the interface fromString issuetoBuilderProblem problem, with deprecated String-based default methods for backward compatibility. Added japicmp exclusion for the intentional API break.Commit 2: Migrate PluginValidationManager to native BuilderProblem API
PluginValidationManagerinterface: 3 abstract methods now acceptBuilderProbleminstead ofString@Deprecated(since = "4.1.0", forRemoval = true)String-based default methods as backward-compat adaptersBuilderProblemnativelyDefaultDiagnosticCollectorintoDefaultPluginValidationManagerDefaultPluginValidationManagertoEXCLUDED_LOGGERSinBuildReportCollectorTest plan
mvn test -pl impl/maven-core— 620 tests pass, 0 failuresmvn install -pl api/maven-api-core,impl/maven-core— builds clean including japicmp check